/**
 * Generali Solutions d'assurances - Tous droits réservés &copy; 2007 - 2010
 */

package fr.generali.accueilclient.opt.recherchemulticriteres.builder;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import fr.generali.accueilclient.opt.recherchemulticriteres.om.ICampagneRechMultiCriteres;
import fr.generali.accueilclient.opt.recherchemulticriteres.om.IClientRechMultiCriteres;
import fr.generali.accueilclient.opt.recherchemulticriteres.om.IDossierRechMultiCriteres;
import fr.generali.accueilclient.opt.recherchemulticriteres.om.IMotifsRechMultiCriteres;
import fr.generali.accueilclient.opt.recherchemulticriteres.om.impl.DTODossierRechMultiCriteres;

/**
 * @author Holmes Kelly
 */
public class DTODossierRechMultiCriteresBuilder extends
                DTODossierRechMultiCriteresBuilderBase<DTODossierRechMultiCriteresBuilder> {

    /**
     * constructeur
     */
    public DTODossierRechMultiCriteresBuilder() {
        super(new DTODossierRechMultiCriteres());
    }

    /**
     * @return DTODossierRechMultiCriteresBuilder
     */
    public static DTODossierRechMultiCriteresBuilder dTODossierRechMultiCriteres() {
        return new DTODossierRechMultiCriteresBuilder();
    }

    /**
     * @return DTODossierRechMultiCriteres
     */
    public IDossierRechMultiCriteres build() {
        return getInstance();
    }
}

/**
 * @author Holmes Kelly
 * @param <GeneratorT>
 */
class DTODossierRechMultiCriteresBuilderBase<GeneratorT extends DTODossierRechMultiCriteresBuilderBase<GeneratorT>> {

    /**
     * instance
     */
    private IDossierRechMultiCriteres instance;

    /**
     * @param aInstance instance
     */
    protected DTODossierRechMultiCriteresBuilderBase(IDossierRechMultiCriteres aInstance) {
        instance = aInstance;
    }

    /**
     * @return instance
     */
    protected IDossierRechMultiCriteres getInstance() {
        return instance;
    }

    /**
     * @param aValue identifiant intermediaire
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantIntermediaire(String aValue) {
        instance.setIdentifiantIntermediaire(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom acteur responsable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNomActeurResponsable(String aValue) {
        instance.setNomActeurResponsable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue numero reference
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNumeroReference(String aValue) {
        instance.setNumeroReference(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant responsable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantResponsable(String aValue) {
        instance.setIdentifiantResponsable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code issue
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeIssue(String aValue) {
        instance.setCodeIssue(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code statut
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeStatut(String aValue) {
        instance.setCodeStatut(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code origine
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeOrigine(String aValue) {
        instance.setCodeOrigine(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue sous type
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildSousType(String aValue) {
        instance.setSousType(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue visibilite
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildVisibilite(BigInteger aValue) {
        instance.setVisibilite(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue creation date
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCreationDate(Date aValue) {
        instance.setCreationDate(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue cloture date
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildClotureDate(Date aValue) {
        instance.setClotureDate(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue client
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildClient(IClientRechMultiCriteres aValue) {
        instance.setClient(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue motifs
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildMotifs(List<IMotifsRechMultiCriteres> aValue) {
        instance.setMotifs(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue added motifs
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildAddedMotif(IMotifsRechMultiCriteres aValue) {
        if (instance.getMotifs() == null) {
            instance.setMotifs(new ArrayList<IMotifsRechMultiCriteres>());
        }

        ((ArrayList<IMotifsRechMultiCriteres> ) instance.getMotifs()).add(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue campagne
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCampagne(ICampagneRechMultiCriteres aValue) {
        instance.setCampagne(aValue);

        return (GeneratorT ) this;
    }
}
